package com.adingxiong.quickstart.project.entity.vo;

import com.adingxiong.quickstart.project.entity.User;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @ClassName UserVo
 * @Description TODO
 * @Author xiongchao
 * @Date 2020/5/28 9:53
 **/
@Data
public class UserVo implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "登录名")
    private String username;

    @ApiModelProperty(value = "密码")
    private String password;


    @ApiModelProperty(value = "电话")
    private String tel;

    @ApiModelProperty(value = "头像路径")
    private String imgUrl;

    @ApiModelProperty(value = "是否有效 1 已激活 2 失效")
    private Integer isflag;

    @ApiModelProperty(value = "账号有效性")
    private boolean status;

    @ApiModelProperty(value = "创建人")
    private String creator;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "角色id")
    private Integer roleId;

    @ApiModelProperty(value = "角色名称")
    private String roleName;

    /**
     * 复制值
     * @param user
     */
    public UserVo (User user){
        BeanUtils.copyProperties(user,this);
    }
}
